-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python: Fix GroupChat orchestrator message cleanup issue #3712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: Fix GroupChat orchestrator message cleanup issue #3712
Conversation
Apply clean_conversation_for_handoff to GroupChatOrchestrator and AgentBasedGroupChatOrchestrator _handle_response methods to remove tool-related content that causes API errors from empty messages. Fixes microsoft#3705
…-3705-1770327487 # Conflicts: # python/packages/orchestrations/agent_framework_orchestrations/_group_chat.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where group chat orchestrators fail with API errors due to empty messages when tool-related content is not properly cleaned from the conversation history. The fix applies the existing clean_conversation_for_handoff utility function to remove tool calls, tool responses, and function approval requests before appending messages to the conversation history or broadcasting them to participants.
Changes:
- Import
clean_conversation_for_handofffrom_orchestrator_helpersmodule - Apply message cleaning in
GroupChatOrchestrator._handle_responseafter processing participant responses - Apply the same cleaning in
AgentBasedGroupChatOrchestrator._handle_responsefor consistency
Apply clean_conversation_for_handoff to GroupChatOrchestrator and AgentBasedGroupChatOrchestrator _handle_response methods to remove tool-related content that causes API errors from empty messages.
Moves remaining orchestration-related files to the orchestrations package (were previously missed in the original PR to move things).
Fixes #3705
Contribution Checklist